package com.qf.service.impl;

import com.qf.dao.StoreInfoRepository;
import com.qf.pojo.entity.StoreInfo;
import com.qf.pojo.resp.BaseResp;
import com.qf.service.StoreInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Optional;

/**
 * @ClassName StoreInfoServiceImpl
 * @Description TODO
 * @Author Windy
 * @Date 2022/10/6 13:31
 * @Version 1.0
 **/
@Service
public class StoreInfoServiceImpl implements StoreInfoService {
    @Autowired
    StoreInfoRepository storeInfoRepository;

    @Override
    public BaseResp findStoreInfo(int storeId) {
        StoreInfo byId = storeInfoRepository.findById(storeId);
        return new BaseResp(200,"success",byId);
    }

    @Override
    public BaseResp upSave(StoreInfo storeInfo) {
        storeInfoRepository.saveAndFlush(storeInfo);
        return new BaseResp().SUCCESS();
    }
}
